Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reducing the amount of written code for helpers that delegate methods to other objects #24

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

erisdev
Copy link
Contributor

@erisdev erisdev commented Feb 28, 2011

I've made use of Ruby's Forwardable module to shorten delegate methods to a single line each. Thus:

def add_game_object(object)
  @game_objects.add_game_object(object)
end

becomes

def_delegator :@game_objects, :add_game_object

Also extracted the duplicated FPS counter code from Window and Console into a new helper module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant